llama-server, llama-cli, llama-sweep-bench, llama-bench, llama-imatrix, and llama-quantize parameters. All parameters supported by llama-server can also be used with the other tools where applicable.
LLM jargon
LLM jargon
Common terms used throughout this documentation and in model descriptions.
General parameters
General parameters
Core parameters for loading and running any model.
Speculative decoding
Speculative decoding
Speculative decoding accelerates generation by using a fast draft model to predict multiple tokens ahead, which the main model then verifies in a single forward pass.
Cache prompt to host memory
Cache prompt to host memory
When a conversation ends, its KV cache is saved to RAM and can be restored when the same or similar prompt is seen again. This greatly reduces prompt processing time when switching between conversations.
Sampling
Sampling
Sampling controls how tokens are selected during generation. The default sampler pipeline provides a good balance for most use cases.For a detailed overview of sampling techniques, see the llm_samplers_explained guide.
Prompt template
Prompt template
The prompt template controls how chat messages are formatted before being sent to the model. An incorrect template can significantly degrade output quality.
Context hacking (KV cache)
Context hacking (KV cache)
The KV cache stores past attention computations to avoid reprocessing tokens. These parameters control where the cache lives and how it is quantized.The KV cache is stored on the same device as the associated attention tensors. Quantizing the KV cache can significantly reduce VRAM usage.
KV cache types (build with
-DGGML_IQK_FA_ALL_QUANTS=ON for the full list):Parallel processing
Parallel processing
Serve multiple users or frontends simultaneously. The WebUI uses parallel slots to allow starting a new chat while another is still generating.
GPU offload
GPU offload
ik_llama.cpp provides extensive control over what runs on the GPU. For a full guide, see GPU offloading and Hybrid CPU/GPU inference.
Model options
Model options
Parameters for configuring how the model is loaded and how draft models work.
Server options
Server options
Parameters specific to
llama-server.Other tools
Other tools
sweep-bench
Benchmarks prompt processing and token generation across a sweep of batch sizes. The KV cache is not cleared between runs, so theN_KV column shows how many tokens were in cache.llama-bench
Standard benchmark utility.llama-imatrix
Generate an importance matrix from calibration text. The imatrix improves quantization quality across all quant types.Notes:
- Use
convert_imatrix_gguf_to_dat.pyto convert GGUF imatrix files to the format used internally. - imatrix calculation supports models with merged
ffn_up/gate_expstensors.
llama-quantize
Quantize a BF16 or F16 model to a compressed format.Build arguments
Build arguments
CMake build configuration flags.
Environment variables
Environment variables
Environment variables that influence runtime behavior.